<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>应用的全局配置选项</title>
    <script src="https://unpkg.com/vue@next"></script>
  </head>
  <body>
    <div id="Application">
      
    </div>
  </body>

  <script>
    const App= Vue.createApp({
        mounted(){
            console.log(this.version)
        }
    })
    
    App.config.errorHandler= (err, vm, info) =>{
        // 捕获运行中产生的异常
        // err为错误对象， info为具体错误信息 
    }

    App.config.warnHandler= (msg, vm, trace) =>{
        // 捕获运行中产生的告警
        // msg为告警信息， trace组件关系回调 
    }

    //配置全局属性
    App.config.globalProperties = {
        version: "1.0.0"
        //可用 this.version来访问
    }
    
    App.mount("#Application")
  </script>

</html>